package com.ruoyi.weixin.juc;

/**
 * @Description: TODO
 * @Author ONESTAR
 * @Date: 2021/12/7 17:16
 * @Version 1.0
 */

// 创建线程方式一:继承Thread类,重写run()方法,调用start()
// 线程不一定立即执行，cpu安排调度

public class TestThread1 extends Thread{

    public static void main(String[] args) {
        TestThread1 testThread1 = new TestThread1();
        testThread1.start();
        for (int i = 0; i < 20000; i++) {
            System.out.println("我在学习多线程---"+i);
        }
    }

    @Override
    public void run(){
        for (int i = 0; i < 20000; i++) {
            System.out.println("我在看代码---"+i);
        }
    }
}
